UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5eevGsZDDKgm4K3JvZXa2V0jeJhG9NC6hB7lQcDpxU='
WHERE
key_id = '1f1f1f4769ee82639ee5ae68e091dd3772cf0fa956c3b25396d5497551e34cb3'
AND (
token = 'G5eevGsZDDKgm4K3JvZXa2V0jeJhG9NC6hB7lQcDpxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)