UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nQhblk+1eOh5pR+Q8S5F/YeuT2NnYeVaQp6NQ5AlxD0='
WHERE
key_id = 'bb5250ff29ec61a1ec6c780da09962abbc145cad113c5cda6175ca37498213a5'
AND (
token = 'nQhblk+1eOh5pR+Q8S5F/YeuT2NnYeVaQp6NQ5AlxD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)