UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pZnyNLK6Mo1Np9z443UUtQhT08NhaoflGzMfBvEOqf0='
WHERE
key_id = '71d1ca250b2861549d18448c2c5f0ab661cd24462713fafbfa16935542c46b7c'
AND (
token = 'pZnyNLK6Mo1Np9z443UUtQhT08NhaoflGzMfBvEOqf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)