UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WyDjO8rA8RgcjAfuj6wtcQ2jJ+FaSfmNLwW9TrEOS/0=' 
WHERE 
  key_id = '94de51af98d76b3cf640604fbb49932e3a28d72ec50f53e500549d6f1ad2d34d' 
  AND (
    token = 'WyDjO8rA8RgcjAfuj6wtcQ2jJ+FaSfmNLwW9TrEOS/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085