UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xvoNjTrkPY5MVko572P1Lzh8GANJB0KV1YYcWgNUg7U='
WHERE
key_id = '34785f68015f8157f916c09d27a66b50888f19ef22a2373027ca5d96ab24416a'
AND (
token = 'xvoNjTrkPY5MVko572P1Lzh8GANJB0KV1YYcWgNUg7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)