UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxR0fxnj2P7ivWu0H/Cj1+OkFQBb0w5kD1y4uHISDpA='
WHERE
key_id = 'e0cd709707d81d594b612fa6921aa649d0af0d9d0915528691c1e2094553f2e9'
AND (
token = 'gxR0fxnj2P7ivWu0H/Cj1+OkFQBb0w5kD1y4uHISDpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)