UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y84a2fmTAw+/UiH/zEP6+q2GFcCJIGgc3UEUBGyIU3M='
WHERE
key_id = 'f786396b4c9e573e0424c64df2b0aaf6f5af16cd164a3518290934fd3fdbf764'
AND (
token = 'y84a2fmTAw+/UiH/zEP6+q2GFcCJIGgc3UEUBGyIU3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)