UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0hA82zeOr1oMyLnl5n3orOeG5WokDxWQ4wFPgJVUZY='
WHERE
key_id = '6a5d9ad5c1abe024964e74876a2ee9fb4cd2b79495c2a7b41e893e26008ba305'
AND (
token = 'Z0hA82zeOr1oMyLnl5n3orOeG5WokDxWQ4wFPgJVUZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)