UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AJZVC4Kea/CdAx4vH+aq4h/LT3w5Cnu33xyWjE3iWVE='
WHERE
key_id = 'b524050071a75bc9baa43d0db5ce059711509e7acb6a682957e22703a2bbf156'
AND (
token = 'AJZVC4Kea/CdAx4vH+aq4h/LT3w5Cnu33xyWjE3iWVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)