UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+E9yNqNfcu6Zp1t+cVluRar9IxOBBiv+bGWraD4X04s=' 
WHERE 
  key_id = '993802a098ed8e474837382d480c200d143d6408085800246d07c7be04c2bd7e' 
  AND (
    token = '+E9yNqNfcu6Zp1t+cVluRar9IxOBBiv+bGWraD4X04s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049