UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/tswGcXkjN0bwLuWmqbgy4iRePTmFMD2EoQ8lv6qoFs=' 
WHERE 
  key_id = '8c1aab42328b1141c6b15def80bc4efdf610b9e392f846cf3a92d5a61a4ac0d4' 
  AND (
    token = '/tswGcXkjN0bwLuWmqbgy4iRePTmFMD2EoQ8lv6qoFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034