UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wenV1JyTA9RWOqrJ403a0ZRignWD9tRfDG5Fyc7hEaU='
WHERE
key_id = '4caf79c8b8b0b151db0368a39489aa5d3ef496f2c834d1cd6b78b669a7735b0e'
AND (
token = 'wenV1JyTA9RWOqrJ403a0ZRignWD9tRfDG5Fyc7hEaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)