UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kb1H5/U3dmUkUqeijdPcdK/3DBkZXXuGUO/dDuxeTWQ=' 
WHERE 
  key_id = 'e1d991ecf5caa3dab5a57f1f36d2f5092e1665a88f9f356c0bbe091db228bd8a' 
  AND (
    token = 'Kb1H5/U3dmUkUqeijdPcdK/3DBkZXXuGUO/dDuxeTWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049