UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RaUDvVB//GMjF9eOIUIugRtquZzz06sEapb/+cmM7dY='
WHERE
key_id = 'eae9433c7178080bc5b475e2b88a11841e480619d991580cfb9dc1cfdd4cb89c'
AND (
token = 'RaUDvVB//GMjF9eOIUIugRtquZzz06sEapb/+cmM7dY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)