UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JACxTArMlZwzZiYnjeEfM6GqmODAMjVmbfZO6ac76g=' 
WHERE 
  key_id = '94bfc7988ab7216e0878fa302c26cc0febe1260c96fa0d63d88081d9368b9460' 
  AND (
    token = '5JACxTArMlZwzZiYnjeEfM6GqmODAMjVmbfZO6ac76g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053