UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOwD/1q4R4CMq1wi0MjZtrAkFR7xefs2wxTD8/aDZbg='
WHERE
key_id = '00a25541dd351261b99a9bd89fc1050ae1bc3fc40506505b9aec0aa0dbb5727a'
AND (
token = 'YOwD/1q4R4CMq1wi0MjZtrAkFR7xefs2wxTD8/aDZbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)