UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NvwhA3/KYJkFx7M9gJqY8nodUEeCOp6H8R0qqo/JRWA='
WHERE
key_id = '906d0b512ea11b13e466ce65f738fc7c05bdf0e149e32ac2810b514528058a5a'
AND (
token = 'NvwhA3/KYJkFx7M9gJqY8nodUEeCOp6H8R0qqo/JRWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)