UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CmMFos4jtbvZ9rg8uWBsTkNmS7abCqpNFdKrGhVrOKg='
WHERE
key_id = '02b1d3b6e7db9be898df6bf8e0d2f3607dab89d83118e176ffe9388dd0349b2d'
AND (
token = 'CmMFos4jtbvZ9rg8uWBsTkNmS7abCqpNFdKrGhVrOKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)