UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YkPT3yVM++38vzTWSE1ayQBiCTjU+r89DQV9CGN+bzM='
WHERE
key_id = '26cc62eccb304e80e67a9ceb30102119aa712ded68746da067b4f777a2879a1b'
AND (
token = 'YkPT3yVM++38vzTWSE1ayQBiCTjU+r89DQV9CGN+bzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)