UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XRlbk8Ne4we7MYrGDQXvN67S7f/4T3isnwz2f9eZBQ8='
WHERE
key_id = '55e1296cb45c52c83e55a8511b24c4fab57990f5e9e884be7d2c87f0c9ad3105'
AND (
token = 'XRlbk8Ne4we7MYrGDQXvN67S7f/4T3isnwz2f9eZBQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)