UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7pV++5Jh37xhkpWxY/3Zz1+uThloSPI2lGK6kJDasUs=' 
WHERE 
  key_id = '13e064d3ce62a032a5472162c0f5041074de7d8b309095b9f20edca2938835f8' 
  AND (
    token = '7pV++5Jh37xhkpWxY/3Zz1+uThloSPI2lGK6kJDasUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023