UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's8riG8xj6Q5zb1R1yM8SSeDs2YwJkhEbUcZcHV2s5no=' 
WHERE 
  key_id = '714e61665c4aec7bcc74f1ac13dfcbbbdc0b320c22143c8cada8b3c7275c0eea' 
  AND (
    token = 's8riG8xj6Q5zb1R1yM8SSeDs2YwJkhEbUcZcHV2s5no=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032