UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MA6bvp6C4tLo2hj3RSB84JJQpUkBUGGMl1xVkQ4wO5k=' 
WHERE 
  key_id = '886a3101908a4af4ed662c5e9276df5f1855fa135d2fdb6efdf8b4f7f9807fa9' 
  AND (
    token = 'MA6bvp6C4tLo2hj3RSB84JJQpUkBUGGMl1xVkQ4wO5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035