UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4+i4aQ3q2iIGNJ63zoPt2688zzEazMEQVBE9x1bb+ww='
WHERE
key_id = 'fa77aec300a27a505816f17a49e28c5cfc9400521471c003c03007da55968baa'
AND (
token = '4+i4aQ3q2iIGNJ63zoPt2688zzEazMEQVBE9x1bb+ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)