UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XtcZ6mqZC7Z8viZb53CTJQBzC+Ws2B7RF/9GCVoJOzo='
WHERE
key_id = 'f43f99fe675bb2a375b157117bd293b5dc87405bca672b60d9589bc19807535b'
AND (
token = 'XtcZ6mqZC7Z8viZb53CTJQBzC+Ws2B7RF/9GCVoJOzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)