UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+q7pThlBj8rvWgdBP+zWu62gK2YuHIE3kf5IrOqpHlw=' 
WHERE 
  key_id = '986660ddb05c1b160332663fcfb0d8ae0a4842f7da88859a990832758375774e' 
  AND (
    token = '+q7pThlBj8rvWgdBP+zWu62gK2YuHIE3kf5IrOqpHlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026