UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm4w2TYSIazSuDHg1Nf5ybnN+6cL3Xy51KPtNVz/KURI='
WHERE
key_id = 'e60093d43948fa02c098533352ad0b62b0aa9b3a2667e4ad0853d2cb40eb44f8'
AND (
token = 'm4w2TYSIazSuDHg1Nf5ybnN+6cL3Xy51KPtNVz/KURI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)