UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nR3ADSCaTgVeFugq9zNQ/ybITogg8zelxo+/cZSQFjE='
WHERE
key_id = 'e05e71965e7fc5e8e17bb7db40c98f1eb0c6a81d5037023ce6d51a6f9ac29739'
AND (
token = 'nR3ADSCaTgVeFugq9zNQ/ybITogg8zelxo+/cZSQFjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)