UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2kwAsU412+FIS0TTJh2KMYVOY8EFJq02yiHXA1rUE3E='
WHERE
key_id = '9001957abd41f3591ed111afb0fe9a8e188f198eda742d38764272f999919612'
AND (
token = '2kwAsU412+FIS0TTJh2KMYVOY8EFJq02yiHXA1rUE3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)