UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FV0smA8Bf++w1qqj5xAW7YBU3mLU1JBCLpipqVHMHoU='
WHERE
key_id = 'c64305b3313df283ec04fe6e046c2c6ef3be1a9ae7ff88b96652f3e30676c16a'
AND (
token = 'FV0smA8Bf++w1qqj5xAW7YBU3mLU1JBCLpipqVHMHoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)